Skip to content

[PGO] Cherry-pick CSPGO LTO linker argument fix#12893

Open
mustartt wants to merge 2 commits intostable/21.xfrom
hjiang/cherry-pick-driver-cspgo-lto-args
Open

[PGO] Cherry-pick CSPGO LTO linker argument fix#12893
mustartt wants to merge 2 commits intostable/21.xfrom
hjiang/cherry-pick-driver-cspgo-lto-args

Conversation

@mustartt
Copy link
Copy Markdown

@mustartt mustartt commented May 4, 2026

When using Darwin's ld, CSPGO options aren't being passed to libLTO.dylib. This patch follows the precedent to re-parse the flag value after the LTOCodeGenerator creation, since these options are only updated after lto_codegen_debug_options.

rdar://175893503

mustartt added 2 commits May 4, 2026 13:25
….dylib (llvm#195020)

Context-sensitive PGO is currently broken when using libLTO.dylib with
ld on Darwin.
1. `Config.RunCSIRInstr` was not set, and was always false.
2. `ThinLTOCodeGenerator::optimizeModule` always passes an empty
PGOOptions.
3. CSPGO flags were only passed for LLD. Now pass to the linker with
`-mllvm` prefix.

(cherry picked from commit 3a02cca)
@mustartt mustartt requested a review from a team as a code owner May 4, 2026 20:56
@mustartt
Copy link
Copy Markdown
Author

mustartt commented May 4, 2026

@swift-ci Please test

@mustartt
Copy link
Copy Markdown
Author

mustartt commented May 4, 2026

@swift-ci test

1 similar comment
@mustartt
Copy link
Copy Markdown
Author

mustartt commented May 6, 2026

@swift-ci test

@mustartt
Copy link
Copy Markdown
Author

mustartt commented May 7, 2026

@swift-ci test

There are still flaky test

@mustartt
Copy link
Copy Markdown
Author

mustartt commented May 7, 2026

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant